package com.zztl.infiniteBand.presenter

import android.content.Context

import com.zztl.infiniteBand.base.BasePresenter
import com.zztl.infiniteBand.model.ContactInfoBean
import com.zztl.infiniteBand.net.FilterSubscriber2
import com.zztl.infiniteBand.net.RetorfitServiceManger
import com.zztl.infiniteBand.ui.view.mvpview.ContactInfoView
import com.zztl.infiniteBand.util.LogUtils


/**
 * @desc
 * @auth ${user}
 * @time 2018/8/1  11:04
 */
class ContactPresenter : BasePresenter<ContactInfoView>() {

    fun getContactInfo(context: Context) {
        addSubscribe(RetorfitServiceManger.observe(RetorfitServiceManger.instance!!.apiService.getContactInfo(""))
                .subscribe(object : FilterSubscriber2<ContactInfoBean>(context) {
                    override fun success(bean: ContactInfoBean) {
                        LogUtils.i("swl", "bean==$bean")
                        view!!.getSuccess(bean)
                    }

                    override fun fail(msg: String?) {

                    }

                }))
    }
}
